<template>
	<view class="app">
		<view class="head">
			<image :src="ans.img" mode="widthFix" class="img"></image>
		</view>
		<view class="mid">
			<view class="tab">
				<view class="text1">
					识别结果:
				</view>
				<view class="text">
					{{ans.ans}}
				</view>
			</view>
		</view>
		<view class="bottom">
			<button type="default" style="background-color: #fff" class="but" @click="back">返回</button>
			<button type="default" style="background-color: #66b0fc;color: #fff;" class="but"
				@click="history">历史</button>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad() {
			this.ans = uni.getStorageSync('ans')
			console.log(this.ans)
		},
		data() {
			return {
				ans: {}
			};
		},
		methods: {
			back() {
				uni.switchTab({
					url: '../index/index'
				})
			},
			history() {
				uni.navigateTo({
					url: '../history/history'
				})
			}
		}
	}
</script>

<style lang="scss">
	.app {
		width: 100%;
		height: calc(100vh - 50px);
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.head {
		width: 95%;
		margin: 0 auto;
		height: 300px;
		border-radius: 8px;
		background-color: aqua;

		.img {
			width: 100%;
			height: 100%;
			border-radius: 8px;
		}
	}

	.mid {
		width: 95%;
		margin: 0 auto;
		height: 300px;
		margin-top: 20px;
		display: flex;
		flex-direction: column;
		justify-content: center;

		.tab {
			display: flex;
			justify-content: space-evenly;
		}
	}

	.bottom {
		display: flex;
		justify-content: space-evenly;
	}

	.but {
		width: 45%;
		height: 50px;
		border-radius: 8px;
	}

	.text {
		font-size: 30px;
		margin-top: -10px;
		font-weight: bold;
		color: #66b0fc;
		text-decoration: underline;
	}
</style>